Reference mask()

mask()

Masks part of the image with another.

img.mask() uses another p5.Image object's alpha channel as the alpha channel for this image. Masks are cumulative and can't be removed once applied. If the mask has a different pixel density from this image, the mask will be scaled.

Examples

Syntax

mask(srcImage)

Parameters

srcImage
p5.Image:

source image.

Notice any errors or typos? Please let us know. Please feel free to edit src/image/p5.Image.js and open a pull request!

Related References